nodeNameResolver = $nodeNameResolver; $this->phpDocInfoFactory = $phpDocInfoFactory; } public function isControllerClassMethod(Class_ $class, ClassMethod $classMethod) : bool { if (!$classMethod->isPublic()) { return \false; } if (!$this->hasParentClassController($class)) { return \false; } $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod); return $phpDocInfo->hasByType(GenericTagValueNode::class); } private function hasParentClassController(Class_ $class) : bool { if (!$class->extends instanceof Name) { return \false; } $parentClassName = $this->nodeNameResolver->getName($class->extends); if (\substr_compare($parentClassName, 'Controller', -\strlen('Controller')) === 0) { return \true; } return \substr_compare($parentClassName, 'Presenter', -\strlen('Presenter')) === 0; } }